package com.huzz.util.desin.facade;

/**外观模式
 * 多媒体播放器
 * @author huzz-
 */
public class MediaPlayerFacade {
    private AudioPlayer audioPlayer;
    private VideoPlayer videoPlayer;

    public MediaPlayerFacade() {
        audioPlayer = new AudioPlayer();
        videoPlayer = new VideoPlayer();
    }

    public void playAudio(String fileName) {
        audioPlayer.loadFile(fileName);
        audioPlayer.adjustVolume();
        audioPlayer.play();
    }

    public void playVideo(String fileName) {
        videoPlayer.loadFile(fileName);
        videoPlayer.adjustResolution();
        videoPlayer.play();
    }
}
